
const mysql = require('mysql')
let connObj = mysql.createConnection({
    host: '127.0.0.1',
    user: 'root',
    password: 'root',
    port: 3306,
    database: 'u_project_v1'
})

function myQuery(sql=''){
    return new Promise((resolve, reject) => {
        connObj.query(sql, (err, result) => { 
           resolve({ err,result }) 
        })
    })

}

module.exports = myQuery
